package com.daxue.bootckafka;

import org.springframework.boot.Banner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class BootCkafkaApplication {

    public static void main(String[] args) {
        /**
         * 1.直接运行
         */
//        SpringApplication.run(BootCkafkaApplication.class, args);


        /**
         * 2. 自定义运行
         */
//        SpringApplication application =
//            new SpringApplication(BootCkafkaApplication.class);
//        application.setBannerMode(Banner.Mode.CONSOLE);
//        application.setWebApplicationType(WebApplicationType.NONE);
//        application.setAdditionalProfiles("prod");
//        application.setHeadless(true);
//        application.run(args);

        ConfigurableApplicationContext prod = new SpringApplicationBuilder(BootCkafkaApplication.class)
            .bannerMode(Banner.Mode.CONSOLE)
            .web(WebApplicationType.NONE)
            .profiles("prod")
            .headless(true)
            .run(args);


    }

}
